import os
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

#  配置路径并打开页面
file = "file:///"+os.path.abspath("../html/upload_file.html")
driver = webdriver.Chrome()
driver.get(file)
#
file1 = os.path.abspath("../课上代码/01 弹窗处理.py")
time.sleep(2)
driver.find_element(By.NAME, "file").send_keys(file1)

time.sleep(3)
driver.quit()


